/**
 * 
 */
package com.changil.admin.protocol.http.request;

import org.apache.http.message.BasicNameValuePair;

import com.changil.admin.protocol.http.HttpUtil;

/**
 * @author skplanet
 * 
 */
public class ModifyArticleRequest extends BasePostHttpRequest {
	private int mId;
	private String mTitle;
	private String mContent;

	public ModifyArticleRequest(int id, String title, String content) {
		mId = id;
		mTitle = title;
		mContent = content;
	}

	@Override
	protected void setParams() {
//		try {
			mPath = "/articles/article";
			mParams.add(new BasicNameValuePair("id", Integer.toString(mId)));
//			mParams.add(new BasicNameValuePair("title", URLEncoder.encode(mTitle, "utf-8")));
//			mParams.add(new BasicNameValuePair("content", URLEncoder.encode(mContent, "utf-8")));
			mParams.add(new BasicNameValuePair("title", mTitle));
			mParams.add(new BasicNameValuePair("content", mContent));
//		} catch (UnsupportedEncodingException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
	}

	@Override
	public String request() {
		setParams();
		return HttpUtil.put(mPath, mParams);
	}
}
